﻿using Autofac;
using Jinjia.Core.BaseInfrastructure.StorageModel.RepositoryBase;
using Jinjia.Core.SignInterface;

namespace Jinjia.Approve.Repository.DI
{
    public class RepositoryModule : InjectionModule
    {
        protected override void Load(ContainerBuilder builder)
        {
            base.Load(builder);
            builder.RegisterAssemblyTypes(typeof(RepositoryModule).Assembly)
                .InstancePerLifetimeScope()
                .AsImplementedInterfaces()
                .PropertiesAutowired();

            builder.RegisterGeneric(typeof(RepositoryBase<>)).As(typeof(IRepositoryBase<>)).InstancePerDependency().AsSelf().PropertiesAutowired();
        }
    }
}